<template>
  <div class="card-container" id="tabsId">
    <a-tabs :activeKey="defaultActiveKey" @change="callback" >
      <a-tab-pane key="1" tab="基本信息">
<!--        @is-disable="isDisable"-->
        <basic ref="basicInfo" @router-pane="back" />
      </a-tab-pane>
      <a-tab-pane key="2" tab="面试情况">
        <interview ref="interviewInfo" @router-pane="back" />
      </a-tab-pane>
      <a-tab-pane key="3" tab="项目经历" >
        <project ref="projectInfo" @router-pane="back"/>
      </a-tab-pane>
      <a-tab-pane key="4" tab="教育经历" >
        <education ref="educationInfo" @router-pane="back"/>
      </a-tab-pane>
      <a-tab-pane key="5" tab="专业技能" >
        <professional ref="professionalInfo" @router-pane="back"/>
      </a-tab-pane>
      <a-tab-pane key="6" tab="获奖情况" >
        <awards ref="awardsInfo" @router-pane="back"/>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>
<script>
    //基本信息
    import Basic from '@/views/internship/Basic';
    //面试情况
    import Interview from '@/views/interview/Details';
    //项目经历
    import Project from '@/views/project/Tabs';
    //教育经历
    import Education from '@/views/education/Tabs';
    //专业技能
    import Professional from '@/views/professional/List';
    //获奖情况
    import Awards from '@/views/awards/List';

    export default {
        name:"Details",
        components:{Basic,Interview,Project,Education,Professional,Awards},
        data() {
            return {
                defaultActiveKey: '1',
                heightTable:document.documentElement.clientHeight,
                basicId:0,
                isDisable:false,
            }
        },
        methods: {
            //首次打开默认为第一个页面
            active(){
                this.defaultActiveKey = '1';
            },
            //加载高度
            initLoadHeight(height){
                this.heightTable = height;
                this.callback(this.defaultActiveKey);
            },
            //返回
            back(paneValue,id){
                this.$emit('router-pane',paneValue,id)
            },
            callback(key) {
                switch(key){
                    case '1':
                        this.defaultActiveKey = '1'
                        this.$nextTick(()=>{
                            this.$refs.basicInfo.initLoadHeight(this.heightTable);
                            this.$refs.basicInfo.initBasicId(this.basicId);
                            this.$refs.basicInfo.isDisable(this.isDisable);
                        })
                        break
                    case '2':
                        this.defaultActiveKey = '2'
                        this.$nextTick(()=>{
                            this.$refs.interviewInfo.initLoadHeight(this.heightTable);
                            this.$refs.interviewInfo.initBasicId(this.basicId);
                            this.$refs.interviewInfo.isDisable(this.isDisable);
                        })
                        break
                    case '3':
                        this.defaultActiveKey = '3'
                        this.$nextTick(()=>{
                            this.$refs.projectInfo.initLoadHeight(this.heightTable);
                            this.$refs.projectInfo.initBasicId(this.basicId);
                            this.$refs.projectInfo.isDisable(this.isDisable);
                        })
                        break
                    case '4':
                        this.defaultActiveKey = '4'
                        this.$nextTick(()=>{
                            this.$refs.educationInfo.initLoadHeight(this.heightTable);
                            this.$refs.educationInfo.initBasicId(this.basicId);
                            this.$refs.educationInfo.isDisable(this.isDisable);
                        })
                        break
                    case '5':
                        this.defaultActiveKey = '5'
                        this.$nextTick(()=>{
                            this.$refs.professionalInfo.initLoadHeight(this.heightTable);
                            this.$refs.professionalInfo.initBasicId(this.basicId);
                            this.$refs.professionalInfo.isDisable(this.isDisable);
                        })
                        break
                    case '6':
                        this.defaultActiveKey = '6'
                        this.$nextTick(()=>{
                            this.$refs.awardsInfo.initLoadHeight(this.heightTable);
                            this.$refs.awardsInfo.initBasicId(this.basicId);
                            this.$refs.awardsInfo.isDisable(this.isDisable);
                        })
                        break
                }
            },
            getId(id,isDisable){
                this.basicId = id;
                this.isDisable = isDisable;
            },
            // getIsDisable(){
            //     return this.isDisable;
            // }
        },
        created() {
        }
    }
</script>
<style>

  ::-webkit-scrollbar-track{
    background-color: white;
  }

  /*button*/
  .head_group button{
    margin: 0px 10px;
    font-size: 14px;
  }

  /* span样式 */
  .tagSpan{
    margin-top: 10px;
    margin-bottom: 30px;
  }
  .tagSpan span{
    font-size: 16px;
    font-weight: bold;
  }

  #tabsId{
    padding:0px;
    margin:0px;
    background-color: white;
  }

  /*layout布局*/
  #components-layout-demo-basic {
    /*text-align: center;*/
  }
  #components-layout-demo-basic .ant-layout-header {
    background-color:transparent;
    height: 60px;
    line-height: 1.5;
    margin: 0px;
    padding: 0px;
  }
  #components-layout-demo-basic .ant-layout-footer {
    line-height: 1.5;
    /*position: fixed;*/
    /*left: 50%;*/
    /*bottom: 2%;*/
    /*transform: translateX(calc(-50% + 100px));*/
    text-align: center;
  }
  #components-layout-demo-basic .ant-layout-content {
    color: #fff;
    min-height: 120px;
    line-height: 120px;
  }
  #components-layout-demo-basic > .ant-layout {
    margin-bottom: 48px;
  }
  #components-layout-demo-basic > .ant-layout:last-child {
    margin: 0;
  }

</style>